﻿using System;
using SL8.SL.ViewModels;

namespace SL8.SL
{
    public class SearchColumnInfo<T> : ObservableObject
    {
        public string ColumnName
        {
            get
            {
                return this.GetCacheValue(o => o.ColumnName, string.Empty);
            }

            set
            {
                this.SetCacheValue(o => o.ColumnName, value);
                this.RaisePropertyChanged(o => o.ColumnName);
            }
        }


        public string Description
        {
            get
            {
                return this.GetCacheValue(o => o.Description, string.Empty);
            }

            set
            {
                this.SetCacheValue(o => o.Description, value);
                this.RaisePropertyChanged(o => o.Description);
            }
        }

        public T Value
        {
            get
            {
                return this.GetCacheValue(o => o.Value, default(T));
            }

            set
            {
                this.SetCacheValue(o => o.Value, value);
                this.RaisePropertyChanged(o => o.Value);
            }
        }

        public bool IsChecked
        {
            get
            {
                return this.GetCacheValue(o => o.IsChecked, false);
            }

            set
            {
                this.SetCacheValue(o => o.IsChecked, value);
                this.RaisePropertyChanged(o => o.IsChecked);
            }
        }
    }

    public class SearchColumnInfo : SearchColumnInfo<string>
    { }
}
